import request from '@/utils/request'

export async function orderInfo<T>(params: T) {
  return request('/api/merchant/orderInfo', {
    method: 'GET',
    params
  })
}

export async function getRisk<T>(data: T) {
  return request('/api/getRisk', {
    method: 'POST',
    data
  })
}

export async function userAuthenticationInfo<T>(params: T) {
  return request('/api/ali/userAuthenticationInfo', {
    method: 'GET',
    params
  })
}

export async function orderExpress<T>(params: T, hideNotice?: T) {
  return request('/api/applet/orderExpress', {
    method: 'GET',
    params,
    hideNotice
  })
}

export async function lookContract<T>(data: T) {
  return request('/api/applet/lookContract', {
    method: 'POST',
    data
  })
}

export async function refreshContract<T>(data: T) {
  return request('/api/backend/refreshContract', {
    method: 'POST',
    data
  })
}

export async function getCreditQueryTime<T>(data: T) {
  return request('/api/getCreditQueryTime', {
    method: 'POST',
    data
  })
}

export async function isOpenNotary<T>(params: T) {
  return request('/api/notarization/isOpenNotary', {
    method: 'GET',
    params
  })
}

export async function auditOrder<T>(data: T) {
  return request('/api/backend/auditOrder', {
    method: 'POST',
    data
  })
}

// 征信 ------------------------------

// 用户征信查询注册并生成文件
export async function userCreateSign<T>(data: T) {
  return request('/api/credit/userCreateSign', {
    method: 'POST',
    data
  })
}

// 征信查询申请
export async function applyCreditQuery<T>(data: T) {
  return request('/api/credit/applyCreditQuery', {
    method: 'POST',
    data
  })
}

// 获取征信查询结果
export async function getCreditQueryResult<T>(params: T) {
  return request('/api/credit/getCreditQueryResult', {
    method: 'GET',
    params
  })
}

// 征信上报申请担保
export async function applyContractLeasing<T>(data: T) {
  return request('/api/credit/applyContractLeasing', {
    method: 'POST',
    data
  })
}

// 担保申请结果查询
export async function applyResultQuery<T>(params: T) {
  return request('/api/credit/applyResultQuery', {
    method: 'GET',
    params
  })
}

// 每期还款
export async function repayment<T>(data: T) {
  return request('/api/credit/repayment', {
    method: 'POST',
    data
  })
}

// 发起结清/逾期上报
export async function settleDataReport<T>(data: T) {
  return request('/api/credit/settleDataReport', {
    method: 'POST',
    data
  })
}

// 结清/逾期上报确认
export async function settleReportConfirm<T>(data: T) {
  return request('/api/credit/settleReportConfirm', {
    method: 'POST',
    data
  })
}

// 获取结清/逾期上报结果
export async function getSettleResult<T>(params: T) {
  return request('/api/credit/getSettleResult', {
    method: 'GET',
    params
  })
}

// 追偿结清
export async function settleRecovery<T>(data: T) {
  return request('/api/credit/settleRecovery', {
    method: 'POST',
    data
  })
}

// 征信 ------------------------------

// 旧征信 ------------------------------

// 征信查询申请
export async function creditQueryCreate<T>(data: T) {
  return request('/api/credit/queryCreate', {
    method: 'POST',
    data
  })
}

// 主动查看征信查询结果
export async function getQueryCreditResult<T>(params: T) {
  return request('/api/credit/getQueryCreditResult', {
    method: 'GET',
    params
  })
}

// 开户上报
export async function creditLoanReport<T>(data: T) {
  return request('/api/credit/creditLoanReport', {
    method: 'POST',
    data
  })
}

// 还款
export async function creditRepay<T>(data: T) {
  return request('/api/credit/repay', {
    method: 'POST',
    data
  })
}

// 结清
export async function creditSettle<T>(data: T) {
  return request('/api/credit/settle', {
    method: 'POST',
    data
  })
}

// 获取并生成上报文件
export async function creditGetReportFile<T>(params: T) {
  return request('/api/credit/generateFileData', {
    method: 'GET',
    params
  })
}

// 旧征信 ------------------------------
